//
//  Person.m
//  KVO--属性依赖
//
//  Created by 岚海网络 on 2018/12/4.
//  Copyright © 2018年 岚海网络. All rights reserved.
//

#import "Person.h"

@implementation Person

- (instancetype)init
{
    self = [super init];
    if (self) {
        _dog = [[Dog alloc] init];
    }
    return self;
}

/*  */
+ (NSSet<NSString *> *)keyPathsForValuesAffectingValueForKey:(NSString *)key
{
    NSSet *keyPath = [super keyPathsForValuesAffectingValueForKey:key];
    if ([key isEqualToString:@"dog"])  {
        //
        keyPath = [[NSSet alloc] initWithObjects:@"_dog.age",@"_dog.level", nil];
    }
    NSLog(@"%@",key);
    return keyPath;
}


@end
